<script setup lang="ts">
import { ref } from 'vue'
import type { ThemeConfig } from 'ant-design-vue/es/config-provider/context'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import { RouterView } from 'vue-router'
import themeConfig from '@/assets/styles/antd-var'
import { px2remTransformer, StyleProvider } from 'ant-design-vue'

dayjs.locale('zh-cn')

const locale = ref(zhCN)

const theme = ref<ThemeConfig>(themeConfig)

const px2rem = px2remTransformer({ rootValue: 1920 / 10, precision: 5, mediaQuery: true })
</script>

<template>
  <a-config-provider :locale="locale" :theme="theme">
    <StyleProvider :transformers="[px2rem]">
      <RouterView />
    </StyleProvider>
  </a-config-provider>
</template>

<style lang="less" scoped></style>
